package com.y.fund.enums;

public enum CompanyType {
	YouXian_ZeRen_1(1,"有限责任公司"), ZiRanRen_DuZi_2(2,"自然人独资"), GeTiHu_3(3,"个体户");
	
       
    private final int val;
    private final String txt;

    CompanyType(int value, String txt) {
        this.val = value;
        this.txt = txt;
    }

    public int getVal() {
        return val;
    }

    public String getTxt() {
        return txt;
    }

    public static CompanyType of(Integer val) {
        if (null != val) {
            for (CompanyType boolVal : CompanyType.values()) {
                if (val.equals(boolVal.getVal())){
                    return boolVal;
                }
            }
        }
        return null;
    }

    /** 根据值获取文本内容 */
    public static Integer Txt2Val(String txt) {
        if (null != txt) {
            for (CompanyType e : CompanyType.values()) {
                if (txt.equals(e.getTxt())){
                    return e.getVal();
                }
            }
        }
        return null;
    }
    
    /** 根据值获取文本内容 */
    public static String Val2Txt(Integer val) {
    	CompanyType ct = of(val);
        return null==ct ? ""+val : ct.getTxt();
    }
    
}
